package Singleton;

public class lazyMan {
    // 私有静态实例，初始化为null
    private static lazyMan instance = null;
    // 私有构造函数，防止外部实例化
    private lazyMan() {
        System.out.println("I have created a lazy man");
    }
    // 公共静态方法，获取单例实例
    public static synchronized lazyMan getInstance() {
        if (instance == null) {
            instance = new lazyMan();
        }

        return instance;
    }
}